#ifndef _EFFECT_ALPHA_H_
#define _EFFECT_ALPHA_H_

#include "effect.h"

namespace animationagent
{

class EffectAlpha : public Effect
{
public:
    enum AnimationStyle {
        LOOP,
        ONCE,
        REVERSAL
    };
    EffectAlpha(Uint8 a1, Uint8 a2, Uint32 duration);
    virtual ~EffectAlpha();
    virtual int Blit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
    virtual bool update();
    void set_playstyle(enum AnimationStyle style);
private:
    Uint32 fade_starttime_msec;
    Uint32 fade_oldtime_msec;
    Uint32 fade_endtime_msec;
    Uint32 fade_duration_msec;
    Uint8  alpha_from;
    Uint8  alpha_to;
    Uint8  current_alpha;
    Sint16 alpha_distance;
    enum AnimationStyle playstyle;
};

}
#endif
